import React from "react";
import "./index.css";
import DivChecked from "../DivChecked";
export default class  extends React.Component{
    
    constructor(props){
        super();
        this.state={
            drone:props.drone,
            accessory:props.accessory,
            iDrone:true,
            iAccessory:false,
            iOther:false
        }
    }
    ChangeDrone(){
        this.setState({
            iDrone:true,
            iAccessory:false,
            iOther:false
        },()=>{
            this.state.drone()
        })
    }
    ChangeAccessory(){
        this.setState({
            iDrone:false,
            iAccessory:true,
            iOther:false
        },()=>{
            this.state.accessory()
        })
    }
    ChangeOther(){
        this.setState({
            iDrone:false,
            iAccessory:false,
            iOther:true
        })
    }
    render(){
        return(
            <span>
                <div className="TradePublishType_Select">
                    <DivChecked title="飞行器" Change={e=>this.ChangeDrone(e)} DivActive={this.state.iDrone}/>
                    <DivChecked title="配件" Change={e=>this.ChangeAccessory(e)} DivActive={this.state.iAccessory}/>
                    <DivChecked title="其他"  Change={e=>this.ChangeOther(e)} DivActive={this.state.iOther}/>
                </div>
            </span>
        )
    }
}